from pathlib import Path
import json

json_file = Path('userName.json')

if json_file.exists():
    name = json_file.read_text()
    name = json.loads(name)
    print(f'hello,{name}')
else:
    name = input('please write you name:\n')
    json_name = json.dumps(name)
    json_file.write_text(json_name)
    print(f'hello,{name}')
